<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>安卓列表界面</title>
		<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css"/>
		<style type="text/css">
			.box{
				padding: 20px 80px 20px 80px;
			}
			button,a,input,textarea{
				
			}
			*{
				cursor: pointer;
				
			}
			
			table td{
				text-align: center;
			}
			.function{
				width: 100%;
				margin: 10px 0 10px 0;
			}
			
			.add_btn{
				float: right;
				
			}
		</style>
	</head>
	<body>
		
		
		<div class="box">
			
			<ol class="breadcrumb">
			  <li><a href="#">公告</a></li>
			  <li><a href="#">安卓</a></li>
			  <li class="active">公告列表</li>
			</ol>
			<div class="function">
				<div class="add_btn"><!--新增按钮-->
					<button class="btn btn-xs btn-success">新增公告</button>
				</div>
				<div style="clear: both;"></div>
			</div>
			<table class="table table-bordered table-hover">
			  <thead>
			  	<tr>
			  		<td width="5%"><strong>#</strong></td>
			  		<td width="15%"><strong>标题</strong></td>
			  		<td width="30%"><strong>内容</strong></td>
			  		<td width="12.5%"><strong>创建日期</strong></td>
			  		<td width="12.5%"><strong>发布日期</strong></td>
			  		<td width="5%"><strong>版本号</strong></td>
			  		<td width="10%"><strong>操作</strong></td>
			  	</tr>
			  </thead>
			  <tbody id="notices">
			  	<tr>
			  		<td><strong>1</strong></td>
			  		<td>修改logo</td>
			  		<td>修改成了好看的logo</td>
			  		<td>2016-02-14 15:55:00</td>
			  		<td>2016-02-14 15:55:00</td>
			  		<td>1.0.4</td>
			  		<td><button class="btn btn-xs btn-danger">删除</button></td>
			  	</tr><tr>
			  		<td><strong>2</strong></td>
			  		<td>修改logo</td>
			  		<td>修改成了好看的logo</td>
			  		<td>2016-02-14 15:55:00</td>
			  		<td>2016-02-14 15:55:00</td>
			  		<td>1.0.4</td>
			  		<td><button class="btn btn-xs btn-danger">删除</button></td>
			  	</tr>
			  	<tr>
			  		<td><strong>3</strong></td>
			  		<td>修改logo</td>
			  		<td>修改成了好看的logo</td>
			  		<td>2016-02-14 15:55:00</td>
			  		<td>2016-02-14 15:55:00</td>
			  		<td>1.0.4</td>
			  		<td><button class="btn btn-xs btn-danger">删除</button></td>
			  	</tr>
			  	<tr>
			  		<td><strong>4</strong></td>
			  		<td>修改logo</td>
			  		<td>修改成了好看的logo</td>
			  		<td>2016-02-14 15:55:00</td>
			  		<td>2016-02-14 15:55:00</td>
			  		<td>1.0.4</td>
			  		<td><button class="btn btn-xs btn-danger">删除</button></td>
			  	</tr>
			  	<tr>
			  		<td><strong>5</strong></td>
			  		<td>修改logo</td>
			  		<td>修改成了好看的logo</td>
			  		<td>2016-02-14 15:55:00</td>
			  		<td>2016-02-14 15:55:00</td>
			  		<td>1.0.4</td>
			  		<td><button class="btn btn-xs btn-danger">删除</button></td>
			  	</tr>
			  	<tr>
			  		<td><strong>6</strong></td>
			  		<td>修改logo</td>
			  		<td>修改成了好看的logo</td>
			  		<td>2016-02-14 15:55:00</td>
			  		<td>2016-02-14 15:55:00</td>
			  		<td>1.0.4</td>
			  		<td><button class="btn btn-xs btn-danger">删除</button></td>
			  	</tr>
			  	<tr>
			  		<td><strong>7</strong></td>
			  		<td>修改logo</td>
			  		<td>修改成了好看的logo</td>
			  		<td>2016-02-14 15:55:00</td>
			  		<td>2016-02-14 15:55:00</td>
			  		<td>1.0.4</td>
			  		<td><button class="btn btn-xs btn-danger">删除</button></td>
			  	</tr>
			  	<tr>
			  		<td><strong>8</strong></td>
			  		<td>修改logo</td>
			  		<td>修改成了好看的logo</td>
			  		<td>2016-02-14 15:55:00</td>
			  		<td>2016-02-14 15:55:00</td>
			  		<td>1.0.4</td>
			  		<td><button class="btn btn-xs btn-danger">删除</button></td>
			  	</tr>
			  	<tr>
			  		<td><strong>9</strong></td>
			  		<td>修改logo</td>
			  		<td>修改成了好看的logo</td>
			  		<td>2016-02-14 15:55:00</td>
			  		<td>2016-02-14 15:55:00</td>
			  		<td>1.0.4</td>
			  		<td><button class="btn btn-xs btn-danger">删除</button></td>
			  	</tr>
			  	<tr>
			  		<td><strong>10</strong></td>
			  		<td>修改logo</td>
			  		<td>修改成了好看的logo</td>
			  		<td>2016-02-14 15:55:00</td>
			  		<td>2016-02-14 15:55:00</td>
			  		<td>1.0.4</td>
			  		<td><button class="btn btn-xs btn-danger">删除</button></td>
			  	</tr>
			  </tbody>
			  <tfoot>
			  	<tr>
			  		<td colspan="7">
			  			<button class="btn btn-xs btn-primary">上一页</button>
			  			<button class="btn btn-xs btn-primary">下一页</button>
			  		</td>
			  	</tr>
			  </tfoot>
			</table>
		</div>
		
		
		<script src="js/jquery-2.1.4.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			$(document).ready(ready);
			
			//页面载入需要执行的操作
			function ready(){
				findNoticeList(0);
			}
			
			function findNoticeList(page){
				$.ajax({
					url:"/Notice/noticeController/findNoticeList?page="+page,
					success:function(json){
						if(json.success){
							var notices = json.obj;
							var str = "";
							
							for (var i=0; i < notices.length; i ++) {
								
								str += "<tr>"+
										"<td><strong>"+ notices[i].n_id +"</strong></td>"+
										"<td>"+ notices[i].n_title +"</td>"+
										"<td>"+ notices[i].n_content +"</td>"+
										"<td>"+ notices[i].n_create_date +"</td>"+
										"<td>"+ notices[i].n_release_date +"</td>"+
										"<td>"+ notices[i].version_number +"</td>"+
										"<td><button id='"+ notices[i].n_id +"' class="btn btn-xs btn-danger">删除</button></td>"+
										"</tr>";
							}
							
							$("#notices").empty();
							$("#notices").append(str);
							
						}
					}
				});
			}
			
			
		</script>
	</body>
</html>
